package thread.sisuo.xiezuoduixiangsisuo;

import java.awt.*;

public class Taxi {
    private final Dispatcher dispatcher;
    private Point location, destination;

    public Taxi(Dispatcher dispatcher) {
        this.dispatcher = dispatcher;
    }

    public synchronized Point getLocation() {
        return location;
    }

    public synchronized void setLocation(Point location) {

        System.out.println("某个出租车开始设置位置");
        this.location = location;

        dispatcher.notifyAvaliable(this);

    }
}
